package io;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class WorkingTwo {
    public static void main(String[] args) {
        BufferedReader bufferedReader=null;
        FileReader fileReader=null;
        String data=null;
        Integer row=0;
        try {
            fileReader = new FileReader("d:/1.txt");
            bufferedReader = new BufferedReader(fileReader);
            while ((data=bufferedReader.readLine())!=null){
                System.out.println(++row+" "+data);
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                bufferedReader.close();
                fileReader.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
